package tree

import "fmt"

type TreeNode struct {
	Value       int
	Left, Right *TreeNode
}

func (node TreeNode) Print() {
	fmt.Print(node.Value, " ")
}

func (node *TreeNode) SetValue(val int) {
	if node == nil {
		fmt.Println("Setting value to nil node, Ignored")
		return
	}
	node.Value = val
}

func CreateNode(value int) *TreeNode {
	return &TreeNode{
		Value: value,
	}
}
